home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / AIncludes / Dialogs.a < prev    next >
Encoding:
Text File  |  1998-07-17  |  24.6 KB  |  840 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dialogs.a
  3. ;
  4. ;    Contains:    Dialog Manager interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  19. __DIALOGS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  28.     include 'Events.a'
  29.     ENDIF
  30.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  31.     include 'MacWindows.a'
  32.     ENDIF
  33.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  34.     include 'TextEdit.a'
  35.     ENDIF
  36.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  37.     include 'Controls.a'
  38.     ENDIF
  39.  
  40.  
  41.                                                             ; errors & gestalt
  42. gestaltDialogMgrAttr            EQU        'dlog'
  43. gestaltDialogMgrPresent            EQU        $00000001
  44. dialogNoTimeoutErr                EQU        -5640
  45.  
  46.                                                             ; new, more standard names for dialog item types
  47. kControlDialogItem                EQU        4
  48. kButtonDialogItem                EQU        4
  49. kCheckBoxDialogItem                EQU        5
  50. kRadioButtonDialogItem            EQU        6
  51. kResourceControlDialogItem        EQU        7
  52. kStaticTextDialogItem            EQU        8
  53. kEditTextDialogItem                EQU        16
  54. kIconDialogItem                    EQU        32
  55. kPictureDialogItem                EQU        64
  56. kUserDialogItem                    EQU        0
  57. kItemDisableBit                    EQU        128
  58.  
  59.                                                             ; old names for dialog item types
  60. ctrlItem                        EQU        4
  61. btnCtrl                            EQU        0
  62. chkCtrl                            EQU        1
  63. radCtrl                            EQU        2
  64. resCtrl                            EQU        3
  65. statText                        EQU        8
  66. editText                        EQU        16
  67. iconItem                        EQU        32
  68. picItem                            EQU        64
  69. userItem                        EQU        0
  70. itemDisable                        EQU        128
  71.  
  72.                                                             ; standard dialog item numbers
  73. kStdOkItemIndex                    EQU        1
  74. kStdCancelItemIndex                EQU        2                    ; old names
  75. ok                                EQU        1
  76. cancel                            EQU        2
  77.  
  78.                                                             ; standard icon resource id's     
  79. kStopIcon                        EQU        0
  80. kNoteIcon                        EQU        1
  81. kCautionIcon                    EQU        2                    ; old names
  82. stopIcon                        EQU        0
  83. noteIcon                        EQU        1
  84. cautionIcon                        EQU        2
  85.  
  86.  
  87.  
  88.     IF OLDROUTINENAMES THEN
  89.  
  90. ;   These constants lived briefly on ETO 16.  They suggest
  91. ;   that there is only one index you can use for the OK 
  92. ;   item, which is not true.  You can put the ok item 
  93. ;   anywhere you want in the DITL.
  94.  
  95.  
  96.  
  97. kOkItemIndex                    EQU        1
  98. kCancelItemIndex                EQU        2
  99.     ENDIF    ; OLDROUTINENAMES
  100. ;     Dialog Item List Manipulation Constants    
  101. ; typedef SInt16                         DITLMethod
  102.  
  103.  
  104. overlayDITL                        EQU        0
  105. appendDITLRight                    EQU        1
  106. appendDITLBottom                EQU        2
  107. ; typedef SInt16                         StageList
  108.  
  109. ;  DialogRef is obsolete. Use DialogPtr instead.
  110. ; typedef DialogPtr                     DialogRef
  111.  
  112. DialogRecord            RECORD 0
  113. window                     ds        WindowRecord    ; offset: $0 (0)
  114. items                     ds.l    1                ; offset: $9C (156)
  115. textH                     ds.l    1                ; offset: $A0 (160)
  116. editField                 ds.w    1                ; offset: $A4 (164)
  117. editOpen                 ds.w    1                ; offset: $A6 (166)
  118. aDefItem                 ds.w    1                ; offset: $A8 (168)
  119. sizeof                     EQU *                    ; size:   $AA (170)
  120.                         ENDR
  121. ; typedef struct DialogRecord *            DialogPeek
  122.  
  123. DialogTemplate            RECORD 0
  124. boundsRect                 ds        Rect            ; offset: $0 (0)
  125. procID                     ds.w    1                ; offset: $8 (8)
  126. visible                     ds.b    1                ; offset: $A (10)
  127. filler1                     ds.b    1                ; offset: $B (11)
  128. goAwayFlag                 ds.b    1                ; offset: $C (12)
  129. filler2                     ds.b    1                ; offset: $D (13)
  130. refCon                     ds.l    1                ; offset: $E (14)
  131. itemsID                     ds.w    1                ; offset: $12 (18)
  132. title                     ds        Str255            ; offset: $14 (20)
  133. sizeof                     EQU *                    ; size:   $114 (276)
  134.                         ENDR
  135. ; typedef struct DialogTemplate *        DialogTPtr
  136.  
  137. ; typedef DialogTPtr *                    DialogTHndl
  138.  
  139. AlertTemplate            RECORD 0
  140. boundsRect                 ds        Rect            ; offset: $0 (0)
  141. itemsID                     ds.w    1                ; offset: $8 (8)
  142. stages                     ds.w    1                ; offset: $A (10)
  143. sizeof                     EQU *                    ; size:   $C (12)
  144.                         ENDR
  145. ; typedef struct AlertTemplate *        AlertTPtr
  146.  
  147. ; typedef AlertTPtr *                    AlertTHndl
  148.  
  149. ;  new type abstractions for the dialog manager 
  150. ; typedef SInt16                         DialogItemIndexZeroBased
  151.  
  152. ; typedef SInt16                         DialogItemIndex
  153.  
  154. ; typedef SInt16                         DialogItemType
  155.  
  156. ;  dialog manager callbacks 
  157.  
  158.     IF ¬ TARGET_OS_MAC THEN
  159. ;  QuickTime 3.0 
  160. ;
  161. ; pascal void SetModelessDialogCallbackProc(DialogPtr theDialog, QTModelessCallbackProcPtr callbackProc)
  162. ;
  163.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  164.         IMPORT_CFM_FUNCTION SetModelessDialogCallbackProc
  165.     ENDIF
  166.  
  167. ;
  168. ; pascal OSErr GetDialogControlNotificationProc(void *theProc)
  169. ;
  170.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  171.         IMPORT_CFM_FUNCTION GetDialogControlNotificationProc
  172.     ENDIF
  173.  
  174. ;
  175. ; pascal void SetDialogMovableModal(DialogPtr theDialog)
  176. ;
  177.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  178.         IMPORT_CFM_FUNCTION SetDialogMovableModal
  179.     ENDIF
  180.  
  181. ;
  182. ; pascal void *GetDialogParent(DialogPtr theDialog)
  183. ;
  184.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  185.         IMPORT_CFM_FUNCTION GetDialogParent
  186.     ENDIF
  187.  
  188.     ENDIF
  189.  
  190. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  191. ;      • Following types are valid with Appearance 1.0 and later
  192. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  193.  
  194.  
  195.  
  196.                                                             ; Alert types to pass into StandardAlert 
  197. kAlertStopAlert                    EQU        0
  198. kAlertNoteAlert                    EQU        1
  199. kAlertCautionAlert                EQU        2
  200. kAlertPlainAlert                EQU        3
  201. ; typedef SInt16                         AlertType
  202.  
  203.  
  204. kAlertDefaultOKText                EQU        -1                    ; "OK"
  205. kAlertDefaultCancelText            EQU        -1                    ; "Cancel"
  206. kAlertDefaultOtherText            EQU        -1                    ; "Don't Save"
  207. ;  StandardAlert alert button numbers 
  208.  
  209. kAlertStdAlertOKButton            EQU        1
  210. kAlertStdAlertCancelButton        EQU        2
  211. kAlertStdAlertOtherButton        EQU        3
  212. kAlertStdAlertHelpButton        EQU        4
  213.  
  214.                                                             ; Dialog Flags for use in NewFeaturesDialog or dlgx resource 
  215. kDialogFlagsUseThemeBackground    EQU        $01
  216. kDialogFlagsUseControlHierarchy    EQU        $02
  217. kDialogFlagsHandleMovableModal    EQU        $04
  218. kDialogFlagsUseThemeControls    EQU        $08
  219.  
  220.                                                             ; Alert Flags for use in alrx resource 
  221. kAlertFlagsUseThemeBackground    EQU        $01
  222. kAlertFlagsUseControlHierarchy    EQU        $02
  223. kAlertFlagsAlertIsMovable        EQU        $04
  224. kAlertFlagsUseThemeControls        EQU        $08
  225. ;  For dftb resource 
  226.  
  227. kDialogFontNoFontStyle            EQU        0
  228. kDialogFontUseFontMask            EQU        $0001
  229. kDialogFontUseFaceMask            EQU        $0002
  230. kDialogFontUseSizeMask            EQU        $0004
  231. kDialogFontUseForeColorMask        EQU        $0008
  232. kDialogFontUseBackColorMask        EQU        $0010
  233. kDialogFontUseModeMask            EQU        $0020
  234. kDialogFontUseJustMask            EQU        $0040
  235. kDialogFontUseAllMask            EQU        $00FF
  236. kDialogFontAddFontSizeMask        EQU        $0100
  237. kDialogFontUseFontNameMask        EQU        $0200
  238. AlertStdAlertParamRec    RECORD 0
  239. movable                     ds.b    1                ; offset: $0 (0)        ;  Make alert movable modal 
  240. helpButton                 ds.b    1                ; offset: $1 (1)        ;  Is there a help button? 
  241. filterProc                 ds.l    1                ; offset: $2 (2)        ;  Event filter 
  242. defaultText                 ds.l    1                ; offset: $6 (6)        ;  Text for button in OK position 
  243. cancelText                 ds.l    1                ; offset: $A (10)        ;  Text for button in cancel position 
  244. otherText                 ds.l    1                ; offset: $E (14)        ;  Text for button in left position 
  245. defaultButton             ds.w    1                ; offset: $12 (18)        ;  Which button behaves as the default 
  246. cancelButton             ds.w    1                ; offset: $14 (20)        ;  Which one behaves as cancel (can be 0) 
  247. position                 ds.w    1                ; offset: $16 (22)        ;  Position (kWindowDefaultPosition in this case 
  248. ;  equals kWindowAlertPositionParentWindowScreen) 
  249. sizeof                     EQU *                    ; size:   $18 (24)
  250.                         ENDR
  251. ; typedef struct AlertStdAlertParamRec * AlertStdAlertParamPtr
  252.  
  253. ;  ——— end Appearance 1.0 or later stuff
  254.  
  255.  
  256.  
  257.  
  258.  
  259. ;    NOTE: Code running under MultiFinder or System 7.0 or newer
  260. ;    should always pass NULL to InitDialogs.
  261. ;
  262.  
  263. ;
  264. ; pascal void InitDialogs(void *ignored)
  265. ;
  266.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  267.         _InitDialogs:    OPWORD    $A97B
  268.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  269.         IMPORT_CFM_FUNCTION InitDialogs
  270.     ENDIF
  271.  
  272. ;
  273. ; pascal void ErrorSound(SoundUPP soundProc)
  274. ;
  275.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  276.         _ErrorSound:    OPWORD    $A98C
  277.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  278.         IMPORT_CFM_FUNCTION ErrorSound
  279.     ENDIF
  280.  
  281. ;
  282. ; pascal DialogPtr NewDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  283. ;
  284.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  285.         _NewDialog:    OPWORD    $A97D
  286.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  287.         IMPORT_CFM_FUNCTION NewDialog
  288.     ENDIF
  289.  
  290. ;
  291. ; pascal DialogPtr GetNewDialog(SInt16 dialogID, void *dStorage, WindowPtr behind)
  292. ;
  293.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  294.         _GetNewDialog:    OPWORD    $A97C
  295.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION GetNewDialog
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal DialogPtr NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  301. ;
  302.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  303.         _NewColorDialog:    OPWORD    $AA4B
  304.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  305.         IMPORT_CFM_FUNCTION NewColorDialog
  306.     ENDIF
  307.  
  308. ;
  309. ; pascal void CloseDialog(DialogPtr theDialog)
  310. ;
  311.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  312.         _CloseDialog:    OPWORD    $A982
  313.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  314.         IMPORT_CFM_FUNCTION CloseDialog
  315.     ENDIF
  316.  
  317. ;
  318. ; pascal void DisposeDialog(DialogPtr theDialog)
  319. ;
  320.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  321.         _DisposeDialog:    OPWORD    $A983
  322.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  323.         IMPORT_CFM_FUNCTION DisposeDialog
  324.     ENDIF
  325.  
  326. ;
  327. ; pascal void ModalDialog(ModalFilterUPP modalFilter, DialogItemIndex *itemHit)
  328. ;
  329.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  330.         _ModalDialog:    OPWORD    $A991
  331.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  332.         IMPORT_CFM_FUNCTION ModalDialog
  333.     ENDIF
  334.  
  335. ;
  336. ; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  337. ;
  338.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  339.         _IsDialogEvent:    OPWORD    $A97F
  340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION IsDialogEvent
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogPtr *theDialog, DialogItemIndex *itemHit)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         _DialogSelect:    OPWORD    $A980
  349.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  350.         IMPORT_CFM_FUNCTION DialogSelect
  351.     ENDIF
  352.  
  353. ;
  354. ; pascal void DrawDialog(DialogPtr theDialog)
  355. ;
  356.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  357.         _DrawDialog:    OPWORD    $A981
  358.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  359.         IMPORT_CFM_FUNCTION DrawDialog
  360.     ENDIF
  361.  
  362. ;
  363. ; pascal void UpdateDialog(DialogPtr theDialog, RgnHandle updateRgn)
  364. ;
  365.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  366.         _UpdateDialog:    OPWORD    $A978
  367.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION UpdateDialog
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal void HideDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  375.         _HideDialogItem:    OPWORD    $A827
  376.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  377.         IMPORT_CFM_FUNCTION HideDialogItem
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal void ShowDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  382. ;
  383.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  384.         _ShowDialogItem:    OPWORD    $A828
  385.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  386.         IMPORT_CFM_FUNCTION ShowDialogItem
  387.     ENDIF
  388.  
  389. ;
  390. ; pascal DialogItemIndexZeroBased FindDialogItem(DialogPtr theDialog, Point thePt)
  391. ;
  392.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  393.         _FindDialogItem:    OPWORD    $A984
  394.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  395.         IMPORT_CFM_FUNCTION FindDialogItem
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal DialogItemIndex Alert(SInt16 alertID, ModalFilterUPP modalFilter)
  400. ;
  401.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  402.         _Alert:    OPWORD    $A985
  403.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  404.         IMPORT_CFM_FUNCTION Alert
  405.     ENDIF
  406.  
  407. ;
  408. ; pascal DialogItemIndex StopAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  409. ;
  410.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  411.         _StopAlert:    OPWORD    $A986
  412.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  413.         IMPORT_CFM_FUNCTION StopAlert
  414.     ENDIF
  415.  
  416. ;
  417. ; pascal DialogItemIndex NoteAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  418. ;
  419.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  420.         _NoteAlert:    OPWORD    $A987
  421.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  422.         IMPORT_CFM_FUNCTION NoteAlert
  423.     ENDIF
  424.  
  425. ;
  426. ; pascal DialogItemIndex CautionAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  427. ;
  428.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  429.         _CautionAlert:    OPWORD    $A988
  430.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  431.         IMPORT_CFM_FUNCTION CautionAlert
  432.     ENDIF
  433.  
  434. ;
  435. ; pascal void GetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType *itemType, Handle *item, Rect *box)
  436. ;
  437.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  438.         _GetDialogItem:    OPWORD    $A98D
  439.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  440.         IMPORT_CFM_FUNCTION GetDialogItem
  441.     ENDIF
  442.  
  443. ;
  444. ; pascal void SetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType itemType, Handle item, const Rect *box)
  445. ;
  446.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  447.         _SetDialogItem:    OPWORD    $A98E
  448.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  449.         IMPORT_CFM_FUNCTION SetDialogItem
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  454. ;
  455.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  456.         _ParamText:    OPWORD    $A98B
  457.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  458.         IMPORT_CFM_FUNCTION ParamText
  459.     ENDIF
  460.  
  461. ;
  462. ; pascal void SelectDialogItemText(DialogPtr theDialog, DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel)
  463. ;
  464.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  465.         _SelectDialogItemText:    OPWORD    $A97E
  466.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  467.         IMPORT_CFM_FUNCTION SelectDialogItemText
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal void GetDialogItemText(Handle item, Str255 text)
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  474.         _GetDialogItemText:    OPWORD    $A990
  475.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  476.         IMPORT_CFM_FUNCTION GetDialogItemText
  477.     ENDIF
  478.  
  479. ;
  480. ; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  481. ;
  482.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  483.         _SetDialogItemText:    OPWORD    $A98F
  484.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  485.         IMPORT_CFM_FUNCTION SetDialogItemText
  486.     ENDIF
  487.  
  488. ;
  489. ; pascal SInt16 GetAlertStage(void)
  490. ;
  491.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  492.         Macro
  493.         _GetAlertStage        &dest=(sp)
  494.             move.w            $0A9A,&dest
  495.         EndM
  496.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  497.         IMPORT_CFM_FUNCTION GetAlertStage
  498.     ENDIF
  499.  
  500. ;
  501. ; pascal void SetDialogFont(SInt16 value)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  504.         Macro
  505.         _SetDialogFont        &src=(sp)+
  506.             move.w            &src,$0AFA
  507.         EndM
  508.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  509.         IMPORT_CFM_FUNCTION SetDialogFont
  510.     ENDIF
  511.  
  512. ;
  513. ; pascal void ResetAlertStage(void )
  514. ;
  515.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  516.         Macro
  517.         _ResetAlertStage
  518.             clr.w               $0A9A
  519.         EndM
  520.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  521.         IMPORT_CFM_FUNCTION ResetAlertStage
  522.     ENDIF
  523.  
  524.  
  525. ;
  526. ; pascal void AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method)
  527. ;
  528.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  529.         IMPORT_CFM_FUNCTION AppendDITL
  530.     ENDIF
  531.  
  532. ;
  533. ; pascal DialogItemIndex CountDITL(DialogPtr theDialog)
  534. ;
  535.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  536.         IMPORT_CFM_FUNCTION CountDITL
  537.     ENDIF
  538.  
  539. ;
  540. ; pascal void ShortenDITL(DialogPtr theDialog, DialogItemIndex numberItems)
  541. ;
  542.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  543.         IMPORT_CFM_FUNCTION ShortenDITL
  544.     ENDIF
  545.  
  546. ;
  547. ; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  548. ;
  549.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  550.         Macro
  551.         _GetStdFilterProc
  552.             move.w              #$0203,D0
  553.             dc.w                $AA68
  554.         EndM
  555.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  556.         IMPORT_CFM_FUNCTION GetStdFilterProc
  557.     ENDIF
  558.  
  559. ;
  560. ; pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, DialogItemIndex newItem)
  561. ;
  562.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  563.         Macro
  564.         _SetDialogDefaultItem
  565.             move.w              #$0304,D0
  566.             dc.w                $AA68
  567.         EndM
  568.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  569.         IMPORT_CFM_FUNCTION SetDialogDefaultItem
  570.     ENDIF
  571.  
  572. ;
  573. ; pascal OSErr SetDialogCancelItem(DialogPtr theDialog, DialogItemIndex newItem)
  574. ;
  575.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  576.         Macro
  577.         _SetDialogCancelItem
  578.             move.w              #$0305,D0
  579.             dc.w                $AA68
  580.         EndM
  581.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  582.         IMPORT_CFM_FUNCTION SetDialogCancelItem
  583.     ENDIF
  584.  
  585. ;
  586. ; pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks)
  587. ;
  588.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  589.         Macro
  590.         _SetDialogTracksCursor
  591.             move.w              #$0306,D0
  592.             dc.w                $AA68
  593.         EndM
  594.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  595.         IMPORT_CFM_FUNCTION SetDialogTracksCursor
  596.     ENDIF
  597.  
  598.  
  599.  
  600.  
  601. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  602. ;      • Appearance Dialog Routines (available only with Appearance 1.0 and later)
  603. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  604.  
  605.  
  606.  
  607. ;
  608. ; pascal DialogPtr NewFeaturesDialog(void *inStorage, const Rect *inBoundsRect, ConstStr255Param inTitle, Boolean inIsVisible, SInt16 inProcID, WindowPtr inBehind, Boolean inGoAwayFlag, SInt32 inRefCon, Handle inItemListHandle, UInt32 inFlags)
  609. ;
  610.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  611.         Macro
  612.         _NewFeaturesDialog
  613.             move.w              #$110C,D0
  614.             dc.w                $AA68
  615.         EndM
  616.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  617.         IMPORT_CFM_FUNCTION NewFeaturesDialog
  618.     ENDIF
  619.  
  620. ;
  621. ; pascal OSErr AutoSizeDialog(DialogPtr inDialog)
  622. ;
  623.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  624.         Macro
  625.         _AutoSizeDialog
  626.             move.w              #$020D,D0
  627.             dc.w                $AA68
  628.         EndM
  629.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  630.         IMPORT_CFM_FUNCTION AutoSizeDialog
  631.     ENDIF
  632.  
  633. ;
  634. ; pascal OSErr StandardAlert(AlertType inAlertType, StringPtr inError, StringPtr inExplanation, AlertStdAlertParamPtr inAlertParam, SInt16 *outItemHit)
  635. ;
  636.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  637.         Macro
  638.         _StandardAlert
  639.             move.w              #$090E,D0
  640.             dc.w                $AA68
  641.         EndM
  642.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  643.         IMPORT_CFM_FUNCTION StandardAlert
  644.     ENDIF
  645.  
  646. ;
  647. ; pascal OSErr GetDialogItemAsControl(DialogPtr inDialog, SInt16 inItemNo, ControlHandle *outControl)
  648. ;
  649.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  650.         Macro
  651.         _GetDialogItemAsControl
  652.             move.w              #$050F,D0
  653.             dc.w                $AA68
  654.         EndM
  655.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  656.         IMPORT_CFM_FUNCTION GetDialogItemAsControl
  657.     ENDIF
  658.  
  659. ;
  660. ; pascal OSErr MoveDialogItem(DialogPtr inDialog, SInt16 inItemNo, SInt16 inHoriz, SInt16 inVert)
  661. ;
  662.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  663.         Macro
  664.         _MoveDialogItem
  665.             move.w              #$0510,D0
  666.             dc.w                $AA68
  667.         EndM
  668.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  669.         IMPORT_CFM_FUNCTION MoveDialogItem
  670.     ENDIF
  671.  
  672. ;
  673. ; pascal OSErr SizeDialogItem(DialogPtr inDialog, SInt16 inItemNo, SInt16 inWidth, SInt16 inHeight)
  674. ;
  675.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  676.         Macro
  677.         _SizeDialogItem
  678.             move.w              #$0511,D0
  679.             dc.w                $AA68
  680.         EndM
  681.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  682.         IMPORT_CFM_FUNCTION SizeDialogItem
  683.     ENDIF
  684.  
  685. ;
  686. ; pascal OSErr AppendDialogItemList(DialogPtr dialog, SInt16 ditlID, DITLMethod method)
  687. ;
  688.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  689.         Macro
  690.         _AppendDialogItemList
  691.             move.w              #$0412,D0
  692.             dc.w                $AA68
  693.         EndM
  694.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  695.         IMPORT_CFM_FUNCTION AppendDialogItemList
  696.     ENDIF
  697.  
  698.  
  699. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  700. ;      • Dialog Routines available only with Appearance 1.1 and later
  701. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  702.  
  703.  
  704.  
  705. ;
  706. ; pascal OSStatus SetDialogTimeout(DialogPtr inDialog, SInt16 inButtonToPress, UInt32 inSecondsToWait)
  707. ;
  708.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  709.         IMPORT_CFM_FUNCTION SetDialogTimeout
  710.     ENDIF
  711.  
  712. ;
  713. ; pascal OSStatus GetDialogTimeout(DialogPtr inDialog, SInt16 *outButtonToPress, UInt32 *outSecondsToWait, UInt32 *outSecondsRemaining)
  714. ;
  715.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  716.         IMPORT_CFM_FUNCTION GetDialogTimeout
  717.     ENDIF
  718.  
  719. ;
  720. ; pascal OSStatus SetModalDialogEventMask(DialogPtr inDialog, EventMask inMask)
  721. ;
  722.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  723.         IMPORT_CFM_FUNCTION SetModalDialogEventMask
  724.     ENDIF
  725.  
  726. ;
  727. ; pascal OSStatus GetModalDialogEventMask(DialogPtr inDialog, EventMask *outMask)
  728. ;
  729.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  730.         IMPORT_CFM_FUNCTION GetModalDialogEventMask
  731.     ENDIF
  732.  
  733.     IF OLDROUTINENAMES THEN
  734.     ENDIF    ; OLDROUTINENAMES
  735. ;    *****************************************************************************
  736. ;    *                                                                           *
  737. ;    * The conditional STRICT_DIALOGS has been removed from this interface file. *
  738. ;    * The accessor macros to a DialogRecord are no longer necessary.            *
  739. ;    *                                                                           *
  740. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  741. ;    *                                                                           *
  742. ;    *****************************************************************************
  743. ;
  744. ;    Details:
  745. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  746. ;    help ease the transition to Copland.  Shared data structures are difficult
  747. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  748. ;    WindowRecord and other data structures, we would begin the migration to the
  749. ;    discipline wherein system data structures are completely hidden from
  750. ;    applications.
  751. ;    
  752. ;    After many design reviews, we finally concluded that with this sort of
  753. ;    migration, the system could never tell when an application was no longer
  754. ;    peeking at a WindowRecord, and thus the data structure might never become
  755. ;    system owned.  Additionally, there were many other limitations in the
  756. ;    classic toolbox that were begging to be addressed.  The final decision was
  757. ;    to leave the traditional toolbox as a compatibility mode.
  758. ;    
  759. ;    We also decided to use the Handle and Ptr based types in the function
  760. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  761. ;    WindowRef.  The Ref types are still defined in the header files, so all
  762. ;    existing code will still compile exactly as it did before.  There are
  763. ;    several reasons why we chose to do this:
  764. ;    
  765. ;    - The importance of backwards compatibility makes it unfeasible for us to
  766. ;    enforce real opaque references in the implementation anytime in the
  767. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  768. ;    ControlRef, etc.) in the documentation and header files would always be a
  769. ;    fake veneer of opacity.
  770. ;    
  771. ;    - There exists a significant base of books and sample code that neophyte
  772. ;    Macintosh developers use to learn how to program the Macintosh.  These
  773. ;    books and sample code all use direct data access.  Introducing opaque data
  774. ;    types at this point would confuse neophyte programmers more than it would
  775. ;    help them.
  776. ;    
  777. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  778. ;    Changing the interfaces to reflect a false opacity would not provide any
  779. ;    benefit to these developers.
  780. ;    
  781. ;    - Accessor functions are useful in and of themselves as convenience
  782. ;    functions, without being tied to opaque data types.  We will complete and
  783. ;    document the Windows and Dialogs accessor functions in an upcoming release
  784. ;    of the interfaces.
  785. ;
  786.  
  787.  
  788.  
  789.  
  790. ;
  791. ; pascal void CouldDialog(SInt16 dialogID)
  792. ;
  793.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  794.         _CouldDialog:    OPWORD    $A979
  795.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  796.         IMPORT_CFM_FUNCTION CouldDialog
  797.     ENDIF
  798.  
  799. ;
  800. ; pascal void FreeDialog(SInt16 dialogID)
  801. ;
  802.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  803.         _FreeDialog:    OPWORD    $A97A
  804.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  805.         IMPORT_CFM_FUNCTION FreeDialog
  806.     ENDIF
  807.  
  808. ;
  809. ; pascal void CouldAlert(SInt16 alertID)
  810. ;
  811.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  812.         _CouldAlert:    OPWORD    $A989
  813.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  814.         IMPORT_CFM_FUNCTION CouldAlert
  815.     ENDIF
  816.  
  817. ;
  818. ; pascal void FreeAlert(SInt16 alertID)
  819. ;
  820.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  821.         _FreeAlert:    OPWORD    $A98A
  822.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  823.         IMPORT_CFM_FUNCTION FreeAlert
  824.     ENDIF
  825.  
  826.  
  827.  
  828.  
  829.  
  830.     IF ¬ TARGET_OS_MAC THEN
  831.     ENDIF
  832.  
  833.  
  834.  
  835.  
  836.     ENDIF ; __DIALOGS__ 
  837.  
  838.